﻿using System.Collections.Generic;
using System.Web.Mvc;
using Moq;
using NUnit.Framework;
using RMH.Entities;
using RMH.Services;
using RMH.Web.Controllers;


namespace RMH.UnitTests.Web.Controllers.StayControllerSpecs
{
    [TestFixture]
    public class StayController_when_editing_a_patient_by_id : base_automock_test
    {
        private ViewResult result;
        private Stay stay = new Stay() { Id= 1};
        private int stayId = 1;


        public override void establish_context()
        {
            Mock<IStayService>()
                .Setup(s => s.Get(1))
                .Returns(stay);
        }

        public override void because()
        {
            result = Create<StayController>().Details(stayId);
        }

        [Test]
        public void returns_stay_details()
        {
            (result.ViewData.Model as Stay).ShouldEqual(stay);
        }


    }
}
